<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('run_errands', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('user_id')->comment('用户ID');
            $table->string('nick_name')->comment('姓名');
            $table->string('mobile')->comment('手机号');
            $table->string('id_number')->unique()->comment('身份证号');
            $table->integer('school_id')->comment('学校');
            $table->integer('faculty_id')->comment('学院');
            $table->string('specialty')->comment('专业');
            $table->tinyInteger('status')->default(1)->comment('审核状态 1待审核 2审核通过 3审核失败');
            $table->string('id_card_front')->comment('身份证正面');
            $table->string('id_card_reverse_side')->comment('身份证反面');
            $table->string('fail_reason')->nullable()->comment('失败原因');
            $table->tinyInteger('blacklists')->default(1)->comment('黑名单 1否 2是');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('schools');
    }
};
